﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TiPort.TiEntityObjects;
using System.Xml.Serialization;
using TI;
using MergeTI.TiEntityObjects;
using TiEntityObject.Contract;
using TiEntityObject.Common;

namespace TiEntityObject.Notification
{
    public class NotificationCustomerRecuirement
    {
        [XmlElement("sid")]
        public Int64 Sid { get; set; }
        
        public Int64   LotSid { get; set; }

        [XmlElement("quantity")]
        public string quantity { get; set; }

        [XmlElement("maxPrice")]
        public string maxPrice { get; set; }


        public decimal  dMaxPrice { get {
            string v = maxPrice.Replace (".",",");
            decimal r=0;
            Decimal.TryParse(v, out r);
            return r;
          
        } }

        [XmlElement("deliveryPlace")]
        public string DeliveryPlace { get; set; }

        [XmlElement("deliveryTerm")]
        public string DeliveryTerm { get; set; }        

        [XmlElement("paymentCondition")]
        public string  PaymentCondition { get; set; }

        [XmlElement("financeSource")]
        public string FinanceSource { get; set; }
        
        [XmlElement("additionalInfo")]
        public string additionalInfo { get; set; }


        [XmlElement("customer")]
        [LinkObjectAttribute(ChildFieldName = "RegNum", IsDictionaryValue = false, ParentFieldName = "CustomerID")]
        public Customer Customer { get; set; }


        [XmlElement("guaranteeApp")]
        [LinkObjectAttribute(ChildFieldName = "CustomerRecuirementSid", IsPartialObject = true, ParentFieldName = "Sid")]
        public NotificationCustomerRecuirementGuaranteeApp GuaranteeApp { get; set; }

        [XmlElement("guaranteeContract")]
        [LinkObjectAttribute(ChildFieldName = "ID", IsPartialObject = true, ParentFieldName = "Sid")]
        public GuaranteeContract GuaranteeContract { get; set; }

        public string CustomerID { get; set; }

       
    }
}
